package com.kaifamiao.www.demo.do0811;

import java.util.AbstractCollection;
import java.util.Iterator;

public class MyCollection extends AbstractCollection {

    Object[] objs;

    public MyCollection(){
        objs = new Object[10];

    }
    @Override
    public Iterator iterator() {
        return null;
    }

    @Override
    public int size() {
        return 0;
    }
    private class MyIterator implements Iterator{

        int index = -1;

        @Override
        public boolean hasNext() {

            return index < objs.length;
        }

        @Override
        public Object next() {
            if (hasNext()){
                return objs[++ index];
            }
            return null;
        }
    }
}
